@extends('layouts.admin')
@section('content')
	<div id="content-header">
		<h1>角色管理</h1>
		<div class="btn-group">
			<a class="btn btn-large tip-bottom" title="Manage Files"><i class="icon-file"></i></a>
			<a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
			<a class="btn btn-large tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a>
			<a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
		</div>
	</div>
	<div id="breadcrumb">
		<a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i>角色列表</a>
		<a href="#" class="current">角色详情</a>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
								<span class="icon">
									<i class="icon-th"></i>
								</span>
						<span class="label label-info"><a href="{{url('admin/role/create')}}" style="color:white">添加角色</a></span>
					</div>
					<div class="widget-content">
	<form action="{{url('admin/middle')}}" method="post" style="margin:0 auto">
		{{csrf_field()}}
		<table class="add_tab" style="margin:0 auto">
			<tbody>
			<input type="hidden" name="id" value="{{$role_id}}">
			@foreach($role as $r)
			<tr>
				<th>角色标示：</th>
				<td>
					<input type="text" name="name" value="{{$r->name}}" disabled="true">
				</td>
			</tr>
			<tr>
				<th>角色名称：</th>
				<td>
					<input type="text" name="display_name" value="{{$r->display_name}}" disabled="true">
				</td>
			</tr>
			<tr>
				<th>描述：</th>
				<td>
					<textarea name="description" id="" cols="3" rows="3" disabled="true">{{$r->description}}</textarea>
				</td>
			</tr>
			@endforeach
			<tr>
				<th>权限：</th>
				{{--<td style="text-align:center;line-height:50px"><input type="checkbox" name="id[]" value="{{$rules->id}}" style="margin-top:0px" {{ in_array($rules->id,$rule_id)?'checked':'' }}></td>--}}
				<td>
					@foreach($power as $power)
						@if($power->parent_id == 0)
							<p style="margin:0;font-size: 14px; color: #2ca02c;"><label><input type="checkbox" name="role_id[]" value="{{$power->id}}" >{{$power->display_name}}</label></p>
						@else
							<label><input type="checkbox" name="role_id[]" value="{{$power->id}}" {{ in_array($power->id,$rule_id)?'checked':'' }}>{{$power->display_name}}</label>
						@endif
					@endforeach
				</td>
			</tr>
			<tr>
				<th></th>
				<td>
					<input type="submit" value="提交">
					<input type="button" class="back" onclick="history.go(-1)" value="返回">
				</td>
			</tr>
			</tbody>
		</table>
	</form>
					</div>
				</div>

			</div>
		</div>
		<div class="row-fluid">
			<div id="footer" class="span12">
				2012 &copy; Unicorn Admin. Brought to you by <a href="https://wrapbootstrap.com/user/diablo9983">diablo9983</a>
			</div>
		</div>
	</div>
@endsection